/**
 * 自动补全表头公共js
 */
/**
 * json字符串格式化为json对象
 * @param str json字符串
 * @returns {any|null}
 */
function jsonStrInObj(str: string): any | null {
  // console.log("自动补全表格表头", str);
  if (typeof str == "string" && str.length > 0) {
    return JSON.parse(str);
  }
  return null;
}

/** 诊疗项目对照自动补全 */
const clinicTableHeadList =
  "[" +
  "                {" +
  '                    "label": "项目分类",' +
  '                    "prop": "itemClass",' +
  '                    "width": "70",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "class": "dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "项目代码", "prop": "itemCode", "width": "120"},' +
  '                {"label": "项目名称", "prop": "itemName", "width": "180"},' +
  '                {"label": "总价(元)", "prop": "subTotal", "width": "110"},' +
  '                {"label": "项目规格", "prop": "itemSpec", "width": "180"}' +
  "            ]";

/** 价表对照自动补全 */
const priceTableHeadList =
  "[" +
  "                {" +
  '                    "label": "项目分类",' +
  '                    "prop": "itemClass",' +
  '                    "width": "80",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "class": "dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "项目代码", "prop": "itemCode", "width": "110"},' +
  '                {"label": "项目名称", "prop": "itemName", "width": "180"},' +
  '                {"label": "项目单价(元)", "prop": "price", "width": "90"},' +
  '                {"label": "项目规格", "prop": "itemSpec", "width": "90"},' +
  '                {"label": "项目单位", "prop": "units", "width": "70", "dictType": "spec_unit", "class": "dict"}' +
  "            ]";

/** 药品入库自动补全 */
const drugImporOrList =
  "[" +
  "                {" +
  '                    "label": "药品名称",' +
  '                    "prop": "drugName",' +
  '                    "width": "140",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "药品别名", "prop": "drugNameAlias", "width": "110"},' +
  '                {"label": "药品编码", "prop": "drugCode", "width": "110"},' +
  '                {"label": "包装规格", "prop": "packageSpec", "width": "120"},' +
  '                {"label": "包装单位", "prop": "currentUnits", "class":"dict", "dictType": "spec_unit", "width": "80"},' +
  '                {"label": "进货价(元)", "prop": "tradePrice", "width": "90"},' +
  '                {"label": "零售价(元)", "prop": "retailPrice", "width": "90"},' +
  '                {"label": "厂商", "prop": "firmName", "width": "150"},' +
  '                {"label": "包装数量", "prop": "packageNum", "width": "90"}' +
  "            ]";

/** 药品出库自动补全 */
const drugExportList =
  "[" +
  "                {" +
  '                    "label": "药品名称",' +
  '                    "prop": "drugName",' +
  '                    "width": "140",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "药品别名", "prop": "drugNameAlias", "width": "110"},' +
  '                {"label": "药品编码", "prop": "drugCode", "width": "90"},' +
  '                {"label": "包装规格", "prop": "currentSpec", "width": "110"},' +
  '                {"label": "现有库存", "prop": "quantityAndUnits", "width": "90","align": "right","color":"#0066FF"},' +
  '                {"label": "包装单位", "prop": "currentUnits", "class":"dict", "dictType": "spec_unit", "width": "70","align": "left"},' +
  '                {"label": "生产日期", "prop": "produceDate", "class":"date", "width":"90","align": "center"},' +
  '                {"label": "有效期", "prop": "expireDate",  "class":"date", "width":"90","align": "center"},' +
  '                {"label": "进货价(元)", "prop": "tradePrice", "width": "85"},' +
  '                {"label": "零售价(元)", "prop": "retailPrice", "width": "85"},' +
  '                {"label": "厂商", "prop": "", "width": "150"},' +
  '                {"label": "批号", "prop": "batchNo", "width": "90","color":"#0066FF"}' +
  "            ]";

/** 药房申领自动补全 */
const autoApplyForArray =
  "[" +
  "                {" +
  '                    "label": "药品名称",' +
  '                    "prop": "drugName",' +
  '                    "width": "140",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "药品别名", "prop": "drugNameAlias", "width": "110"},' +
  '                {"label": "药品编码", "prop": "drugCode", "width": "90"},' +
  '                {"label": "包装规格", "prop": "currentSpec", "width": "110"},' +
  '                {"label": "库存(参考)", "prop": "quantityAndUnits", "width": "90","align": "right","color":"#0066FF"},' +
  '                {"label": "厂商", "prop": "firmName", "width": "150"}' +
  "            ]";

/** 药品处方自动补全 */
const prescriptionList =
  "[" +
  '                {"label": "名称", "prop": "drugName", "width": "140"},' +
  '                {"label": "药品别名", "prop": "drugNameAlias", "width": "110"},' +
  '                {"label": "剂量/单位", "prop": "doseUnitsAndName", "width": "80"},' +
  '                {"label": "规格", "prop": "currentSpec", "width": "120"},' +
  '                {"label": "单价(元)", "prop": "price", "width": "80"},' +
  '                {"label": "库存", "prop": "quantityAndUnits", "width": "70","color":"#0066FF"},' +
  '                {"label": "厂家", "prop": "firmName", "width": "130","color":"#0066FF"}' +
  "            ]";

/** 手术字典自动补全 */
const surgeryList =
  "[" +
  '                {"label": "手术名称", "prop": "operationName", "width": "160"},' +
  '                {"label": "手术编码", "prop": "operationCode", "width": "110"},' +
  '                {"label": "手术等级", "prop": "operationScale","class":"dict",  "dictType": "operation_grade", "width": "120"},' +
  '                {"label": "单价(元)", "prop": "price", "width": "90"},' +
  '                {"label": "对照相信", "prop": "isControl", "width": "110" }' +
  "            ]";

/** 模板药品自动补全 */
const drugListByTemplate =
  "[" +
  '                {"label": "名称", "prop": "drugName", "width": "140"},' +
  '                {"label": "药品别名", "prop": "drugNameAlias", "width": "110"},' +
  '                {"label": "剂量/单位", "prop": "doseUnitsAndName", "width": "80"},' +
  '                {"label": "规格", "prop": "currentSpec", "width": "120"},' +
  '                {"label": "厂家", "prop": "firmName", "width": "180","color":"#0066FF"}' +
  "            ]";



/** icd10自动补全 */
const icd10List =
  "[" +
  "                {" +
  '                    "label": "诊断编码",' +
  '                    "prop": "code",' +
  '                    "width": "190",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "诊断名称", "prop": "zhongwenMingcheng", "width": "300"},' +
  // '                {"label": "诊断类型", "prop": "diagnosisType", "width": "170"},' +
  '                {"label": "中/西医诊断", "prop": "chineseWesternType","class":"dict",  "dictType": "chinese_western_type", "width": "163"},' +
  '                {"label": "备注", "prop": "otherInfo", "width": "120"}' +
  "            ]";

/** 消耗品入库自动补全 */
const materialImportList =
  "[" +
  "                {" +
  '                    "label": "消耗品名称",' +
  '                    "prop": "materialName",' +
  '                    "width": "140",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "消耗品编码", "prop": "materialCode", "width": "110"},' +
  '                {"label": "包装规格", "prop": "packageSpec", "width": "120"},' +
  '                {"label": "包装单位", "prop": "currentUnits", "class":"dict", "dictType": "spec_unit", "width": "80"},' +
  '                {"label": "进货价(元)", "prop": "tradePrice", "width": "90"},' +
  '                {"label": "零售价(元)", "prop": "retailPrice", "width": "90"},' +
  '                {"label": "厂商", "prop": "firmName", "width": "150"},' +
  '                {"label": "包装数量", "prop": "packageNum", "width": "90"}' +
  "            ]";

/** 消耗品出库自动补全 */
const materialExportList =
  "[" +
  "                {" +
  '                    "label": "消耗品名称",' +
  '                    "prop": "materialName",' +
  '                    "width": "140",' +
  '                    "dictType": "bill_item_class_dict",' +
  '                    "align": "left"' +
  "                }," +
  '                {"label": "消耗品编码", "prop": "materialCode", "width": "90"},' +
  '                {"label": "包装规格", "prop": "currentSpec", "width": "110"},' +
  '                {"label": "现有库存", "prop": "quantityAndUnits", "width": "90","align": "right","color":"#0066FF"},' +
  '                {"label": "包装单位", "prop": "currentUnits", "class":"dict", "dictType": "spec_unit", "width": "70","align": "left"},' +
  '                {"label": "生产日期", "prop": "produceDate", "class":"date", "width":"90","align": "center"},' +
  '                {"label": "有效期", "prop": "expireDate",  "class":"date", "width":"90","align": "center"},' +
  '                {"label": "进货价(元)", "prop": "purchasePrice", "width": "85"},' +
  '                {"label": "零售价(元)", "prop": "retailPrice", "width": "85"},' +
  '                {"label": "厂商", "prop": "firmName", "width": "150"},' +
  '                {"label": "批号", "prop": "batchNo", "width": "90","color":"#0066FF"}' +
  "            ]";

export {
  jsonStrInObj,
  clinicTableHeadList,
  priceTableHeadList,
  drugImporOrList,
  drugExportList,
  icd10List,
  prescriptionList,
  autoApplyForArray,
  materialImportList,
  materialExportList,
  drugListByTemplate,
  surgeryList
}
